/**
 * 
 */
package org.vsg.stock.core.persistence;

import java.util.Collection;
import java.util.List;

import org.springframework.dao.DataAccessException;
import org.vsg.common.orm.hibernate.GenericDao;
import org.vsg.stock.core.domain.StockInfo;

/**
 * @author Bill Vison
 *
 */
public interface StockInfoDao extends GenericDao {

	/**
	 * 
	 * @param entities
	 * @throws DataAccessException
	 */
	public void saveAll(Collection<StockInfo>  entities) throws DataAccessException;
	
	/**
	 * 
	 * @param stockCode
	 * @return
	 * @throws DataAccessException
	 */
	public boolean checkIdExist(String stockCode) throws DataAccessException;

	/**
	 * 
	 * @return
	 * @throws DataAccessException
	 */
	public List<StockInfo> findAllInfo() throws DataAccessException;
	
	/**
	 * 
	 * @return
	 * @throws DataAccessException
	 */
	public List<StockInfo> findAllGroupingInfo() throws DataAccessException;
	
	/**
	 * 
	 * @return
	 * @throws DataAccessException
	 */
	public List<StockInfo> findAllRealInfo() throws DataAccessException;
	
	/**
	 * 
	 * @return
	 * @throws DataAccessException
	 */
	public List<String> findAllName() throws DataAccessException;
	
	/**
	 * 
	 * @return
	 * @throws DataAccessException
	 */
	public List<String> findAllCode() throws DataAccessException;
	
	/**
	 * 
	 * @return
	 * @throws DataAccessException
	 */
	public List<String> findAllGroupingCode() throws DataAccessException;
	
	/**
	 * 
	 * @return
	 * @throws DataAccessException
	 */
	public List<String> findAllRealCode() throws DataAccessException;
	
	/**
	 * 
	 * @param categoryName
	 * @return
	 * @throws DataAccessException
	 */
	public List<String> fineStockCodeByCategoryDescription(String categoryName) throws DataAccessException;
	
	/**
	 * 
	 * @param groupingStkCode
	 * @param realStkCodeList
	 * @throws DataAccessException
	 */
	public void updateStockInfoPartMap(String groupingStkCode , List<String> realStkCodeList) throws  DataAccessException;
	
	/**
	 * 
	 * @param market --- type market->'SH','SZ'
	 * @return
	 * @throws DataAccessException
	 */
	public int totalACapital(String market) throws DataAccessException;
	
	/**
	 * 
	 * @param groupingStockInfo
	 * @return
	 * @throws DataAccessException
	 */
	public int totalGroupingACatital(String groupStockInfoCode) throws DataAccessException;
	
	/**
	 * 
	 * @return
	 * @throws DataAccessException
	 */
	public List<String> findStockPartMapKey() throws DataAccessException;
	
	/**
	 * 
	 * @throws DataAccessException
	 */
	public void cleanAll() throws DataAccessException;
	
	/**
	 * 
	 * @throws DataAccessException
	 */
	public void cleanInfoPartMap() throws DataAccessException;
	
}
